import re

def sanitize_input(currency_str_value):
    return re.sub(r'[^\d\.\-]', '', currency_str_value)

# 带单位的货币输入
currency_str_value = input('请输入带单位的货币金额：')

sanitized_value = sanitize_input(currency_str_value)

unit = sanitized_value[-3:]

if unit == 'CNY':
    exchange_rate = 1 / USD_VS_RMB

elif unit == 'USD':
    exchange_rate = USD_VS_RMB

else:
    exchange_rate = -1

if exchange_rate != -1:
    in_money = float(sanitized_value[:-3])
    # 调用函数
    out_money = convert_currency(in_money, exchange_rate)
    print('转换后的金额：', out_money)
else:
    print('不支持该种货币！')